<%--
    Document   : charts
    Created on : Jan 26, 2013, 11:18:47 PM
    Author     : jaguar
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
        String sr=null;
    if(session.getAttribute("sr")==null){
        response.sendRedirect("index.jsp?msg=Please,Login First");
      //  out.print("<script type='text/javascript'>alert('asfa');</script>");
    }
    else
        sr=session.getAttribute("sr").toString();
%>
<!DOCTYPE html>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>Dashboard - Admin Template</title>
<link rel="stylesheet" type="text/css" href="css/theme.css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script src="js/jquery-ui-1.8.23.custom/js/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="js/highstock.js"></script>
<script src="js/stockchart.js"></script>
<link rel="stylesheet" href="js/jquery-ui-1.8.23.custom/development-bundle/themes/base/jquery.ui.all.css">
<script src="js/jquery-ui-1.8.23.custom/development-bundle/ui/jquery.ui.core.js"></script>
<script src="js/jquery-ui-1.8.23.custom/development-bundle/ui/jquery.ui.widget.js"></script>
<script src="js/jquery-ui-1.8.23.custom/development-bundle/ui/jquery.ui.position.js"></script>
<script src="js/jquery-ui-1.8.23.custom/development-bundle/ui/jquery.ui.autocomplete.js"></script>

<script src="js/jquery-ui-1.8.23.custom/development-bundle/ui/jquery.ui.accordion.js"></script>
<script>
   var StyleFile = "theme" + document.cookie.charAt(6) + ".css";
   document.writeln('<link rel="stylesheet" type="text/css" href="css/' + StyleFile + '">');
</script>
<!--[if IE]>
<link rel="stylesheet" type="text/css" href="css/ie-sucks.css" />
<![endif]-->
         
        <script>
    $(function() {
		$( "#sidebar" ).accordion({
			autoHeight:false,
                        event: "mouseover"
		});
                
                 $.getJSON("1.jsp", function(data){
                                var tags=new Array();
                                $.each(data, function(com,ticker){
                                    tags.push(ticker.name);
                                });
                                           
                                $( "#com" ).autocomplete({
                                    source:tags
                                }); 
                                
                                 $( "#sym_id" ).autocomplete({
                                    source:tags
                                }); 
                            });
	});
    
</script>
<script type="text/javascript">
$("#but").live('click',function() {
        alert("clicked");
        var com_nm=document.getElementById("com").value;
        var data1;
         $.getJSON('macd_json1.jsp', function(data) {
             data1=data;
         });
        $.getJSON('macd_json.jsp', function(data) {
            
		// Create the chart
		window.chart = new Highcharts.StockChart({
			chart : {
				renderTo : 'chart'
			},

			rangeSelector : {
				selected : 1
			},

			title : {
				text : 'AAPL Stock Price'
			},
			
			series : [{
				name : 'MACD Line',
				data : data,
				tooltip: {
					valueDecimals: 2
				}
			},{
                            name:"Signal Line",
                            data:data1,
                        }
                        
                    
            ]
		});
	});
	
});




		</script>
               
		
</head>

<body>
	<div id="container">
    	<div id="header">
        	<h2>Stock Market Website</h2>
    <div id="topmenu">
            	<ul>
                    <li><a href="user_home.jsp">Dashboard</a></li>
                    <li><a href="portfolio.jsp">Portfolio</a></li>
                    <li class="current"><a href="charts.jsp">Charts</a></li>
                <!--    <li><a href="chatgroup_user.jsp">Chat Group</a></li>-->
                    <li><a href="experts_user.jsp">Experts</a></li>
                    <!--                    <li><a href="emails.jsp">Emails</a></li>-->
              </ul>
          </div>
      </div>
      <div id="top-panel">
          <div id="panel">
          <form action="" name="quoteform" >
              	<input type="text" placeholder="Enter company symbol" name="sym_nm" id="sym_id" />
                <input type="submit" value="Get Stock Value" />
            </form>
          </div>
      </div>
        <div id="wrapper">
            <div id="content">
                <div id="box">
                    <p>
                        Enter Company Name:
                        <input type="text" id="com">
                        <input type="button" value="Show Chart!" id="but"/>
                        
                    </p>    
                
                </div>
                <div id="chart"></div>
            </div>
             <div id="chart2"></div>
            </div>
            <div id="sidebar">
  				<li><h3>
                                    <%
                                     //   if(session.getAttribute("sr").equals(null)){
                                       //     response.sendRedirect("index.jsp?msg='Please,Login first'");
                                        //}
                                       // String id=session.getAttribute("sr").toString();
                                       // String name=session.getAttribute("name").toString();
                                       // out.print("Welcome "+name);
                                    %></h3><ul></ul></li>         
                	<li><h3><a href="#" class="house">Dashboard</a></h3>
                        <ul>
                        	<li><a href="logout.jsp" class="report">Logout</a></li>
                        </ul>
                    </li>
                    <li><h3><a href="#" class="report">Charts</a></h3>
          				<ul>
                            
                            <li><a href="candle.jsp" class="report">Candle-Stick</a></li>
                              <li><a href="ohlc.jsp" class="report">OHLC</a></li>

                        </ul>
                    </li>
                   <!-- <li><h3><a href="#" class="folder_table">Orders</a></h3>
          				<ul>
                        	<li><a href="#" class="addorder">Emails</a></li>
                          <li><a href="#" class="shipping">Experts</a></li>
                            <li><a href="#" class="invoices">Invoices</a></li>
                        </ul>
                    </li>-->
                    
                  			       
          </div>
      
      </div>
        <div id="footer">
        <div id="styleswitcher">
            <ul>
                <li><a href="javascript: document.cookie='theme='; window.location.reload();" title="Default" id="defswitch">d</a></li>
                <li><a href="javascript: document.cookie='theme=1'; window.location.reload();" title="Blue" id="blueswitch">b</a></li>
                <li><a href="javascript: document.cookie='theme=2'; window.location.reload();" title="Green" id="greenswitch">g</a></li>
                <li><a href="javascript: document.cookie='theme=3'; window.location.reload();" title="Brown" id="brownswitch">b</a></li>
                <li><a href="javascript: document.cookie='theme=4'; window.location.reload();" title="Mix" id="mixswitch">m</a></li>
            </ul>
        </div><br />

        </div>
</div>
</body>
</html>
               
	